using UnityEngine;

public class WinningsEntry : MonoBehaviour
{
	public UILabel prizeName;

	public UILabel compName;

	public UILabel winnings;

	public GameObject coinsObject;

	public GameObject cashObject;

	public UILabel coinsLabel;

	public UILabel cashLabel;

	public UILabel diamondLabel;

	public UISprite background;

	public UISprite backgroundTop;

	public void Init(LeaderboardsAdapter.ClientPrize prize, string competition, Color color, Color colorTop)
	{
		UITools.ChangeText(prizeName, prize.name);
		UITools.ChangeText(compName, competition + " League");
		if (background != null)
		{
			background.color = color;
		}
		if (backgroundTop != null)
		{
			backgroundTop.color = colorTop;
		}
		if (prize.cash > 0)
		{
			UITools.ChangeText(winnings, GGFormat.FormatWinnings(prize.cash));
			UITools.SetActive(coinsObject, false);
			UITools.SetActive(cashObject, true);
		}
		else if (prize.coins > 0)
		{
			UITools.ChangeText(winnings, GGFormat.FormatWinnings(prize.coins));
			UITools.SetActive(coinsObject, true);
			UITools.SetActive(cashObject, false);
		}
		UITools.ChangeText(coinsLabel, prize.coins.ToString());
		UITools.ChangeText(cashLabel, prize.cash.ToString());
		UITools.ChangeText(diamondLabel, prize.tokens.ToString());
	}
}
